import { modal } from 'vue-strap'
import { showMsg, updateOneTag } from '../../../vuex/action'

export default {
  name: 'UpdateTag',
  props: ['show', 'form'],
  components: {
    'vue-modal': modal
  },
  vuex: {
    actions: {
      xShowMsg: showMsg,
      xUpdateOneTag: updateOneTag
    }
  },
  methods: {
    submit() {
      var params = this.form
      this.xUpdateOneTag(params)
        .then((res) => {
          this.show = false
        })
        .catch((res) => {
          this.xShowMsg({
            type: 'danger',
            content: res.error_msg
          })
        })
    }
  }
}
